<?php


namespace App\Models;


use Askedio\SoftCascade\Traits\SoftCascadeTrait;
use Illuminate\Database\Eloquent\SoftDeletes;

class WarehouseShelfModel extends BaseModel
{
    use SoftDeletes;
    use SoftCascadeTrait;

    protected $softCascade = ['warehouseSite'];
    protected $primaryKey = 'shelf_id';
    protected $table = 'warehouse_shelf';

    public function WarehouseArea()
    {
        return $this->belongsTo(WarehouseAreaModel::class, 'warehouse_area_id', 'warehouse_area_id');
    }

    public function warehouseSite()
    {
        return $this->hasMany(WarehouseSiteModel::class, 'shelf_id', 'shelf_id');
    }

    public function ProductBatch()
    {
        return $this->belongsTo(ProductsBatchModel::class, 'batch_id', 'batch_id');
    }
}
